home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / ArcDir / Install ArcDir < prev    next >
Text File  |  1997-06-06  |  8KB  |  272 lines

  1. ; $VER: Install ArcDir 1.1 (6.6.97)
  2. ; Script to install ArcDir.dopus5 1.1.
  3. ; Written by Edmund Vermeulen <edmundv@xs4all.nl>.
  4.  
  5. (set @default-dest "")
  6.  
  7. (set #proprender (if (>= @installer-version 42) "p" ""))
  8.  
  9.  
  10. ;=============================================================================
  11. ; check if Directory Opus 5 has been installed
  12.  
  13. (if
  14.    (= (exists "DOpus5:DirectoryOpus" (noreq)) 0)
  15.    (abort "Directory Opus 5 must be installed first.")
  16. )
  17.  
  18.  
  19. ;=============================================================================
  20. ; uninstall
  21.  
  22. (if
  23.    (=
  24.       (getversion "ARexx/ArcDir.dopus5")
  25.       (getversion "DOpus5:ARexx/ArcDir.dopus5")
  26.    )
  27.    (if
  28.       (=
  29.          (askchoice
  30.             (prompt "ArcDir.dopus5 is already installed.")
  31.             (help @askchoice-help)
  32.             (choices (cat #proprender "Uninstall it.") "Install it again.")
  33.          )
  34.          0
  35.       )
  36.       (
  37.          (delete "DOpus5:ARexx/ArcDir.dopus5")
  38.          (delete "DOpus5:ARexx/NewArc.dopus5")
  39.          (delete "DOpus5:C/ArcDirList")
  40.          (delete "DOpus5:C/Move")
  41.          (delete "DOpus5:C/LhAQuickList")
  42.          (delete "Locale:Catalogs/nederlands/ArcDir.catalog")
  43.          (delete "Locale:Catalogs/deutsch/ArcDir.catalog")
  44.          (delete "Locale:Catalogs/français/ArcDir.catalog")
  45.          (delete "Locale:Catalogs/norsk/ArcDir.catalog")
  46.          (delete "DOpus5:Filetypes/LHA archive")
  47.          (delete "DOpus5:Filetypes/LZX archive")
  48.  
  49.          (set #storedir
  50.             (if
  51.                (= (exists "DOpus5:Storage/Filetypes") 2)
  52.                "DOpus5:Storage/Filetypes/"
  53.                "DOpus5:Storage/"
  54.             )
  55.          )
  56.          (set #n 0)
  57.          (while
  58.             (set #arctype (select #n "LHA" "LZX" ""))
  59.             (
  60.                (copyfiles
  61.                   (source (cat #storedir #arctype " archive"))
  62.                   (dest "DOpus5:Filetypes")
  63.                )
  64.                (set #n (+ #n 1))
  65.             )
  66.          )
  67.  
  68.          (exit "ArcDir has been uninstalled.")
  69.       )
  70.    )
  71. )
  72.  
  73.  
  74. ;=============================================================================
  75. ; delete old stuff
  76.  
  77. (if
  78.    (= (getversion "DOpus5:ARexx/LhADir.dopus5") 65536)
  79.    (message "Version 1.0 of LhADir.dopus5 detected!\n\n"
  80.             "Please note that ArcDir.dopus5 doesn't need any alterations "
  81.             "to the toolbar or any other buttons in Opus whatsoever.\n\n"
  82.             "You should remove all references to LhADir.dopus5. Copying "
  83.             "the default toolbar over your old toolbar will usually "
  84.             "accomplish this."
  85.    )
  86. )
  87.  
  88. (if
  89.    (= (exists "DOpus5:ARexx/LhADir.dopus5") 1)
  90.    (if
  91.       (askbool
  92.          (prompt "LhADir.dopus5 detected.\n\n"
  93.                  "LhADir has been superseded by ArcDir and is not needed "
  94.                  "any more. Is it okay to delete it?"
  95.          )
  96.          (help "Select 'Yes' to delete LhADir.dopus5 and related files "
  97.                "from your system or 'No' to leave them alone."
  98.          )
  99.          (default 1)
  100.       )
  101.       (
  102.          (delete "DOpus5:ARexx/LhADir.dopus5")
  103.          (delete "DOpus5:ARexx/LhADir-handler")
  104.          (delete "DOpus5:ARexx/NewLhA.dopus5")
  105.          (delete "DOpus5:C/LhADirList")
  106.          (delete "Locale:Catalogs/nederlands/LhADir.catalog")
  107.          (delete "Locale:Catalogs/deutsch/LhADir.catalog")
  108.          (delete "Locale:Catalogs/français/LhADir.catalog")
  109.          (delete "Locale:Catalogs/norsk/LhADir.catalog")
  110.          (delete "DOpus5:Buttons/LhADir Buttons")
  111.          (delete "DOpus5:Buttons/toolbar_LhADir")
  112.       )
  113.    )
  114. )
  115.  
  116.  
  117. ;=============================================================================
  118. ; ask questions first, copy files later
  119.  
  120. (set
  121.    #storeold
  122.    (if
  123.       (= @user-level 2)
  124.       (askbool
  125.          (prompt "Your current filetypes for LHA and LZX will be overwritten. "
  126.                  "Would you like to keep a safe copy of them in the "
  127.                  "'DOpus5:Storage' drawer?\n\n"
  128.                  "In case of an uninstallation these files will be reinstalled."
  129.          )
  130.          (help "Select 'Yes' to copy the files 'LHA archive' and 'LZX archive' "
  131.                "from the 'DOpus5:Filetypes' drawer to the 'DOpus5:Storage' "
  132.                "drawer. If you select 'No', the current (default) filetypes for "
  133.                "LHA and LZX in the Storage drawer will be kept.\n\n"
  134.                "When doing an uninstallation, these filetypes will be "
  135.                "reinstalled from the Storage drawer to the Filetypes drawer. "
  136.                "You can accomplish an uninstallation by running this "
  137.                "installation script again."
  138.         )
  139.       )
  140.    )
  141. )
  142.  
  143. (set
  144.    #how
  145.    (+
  146.       (askchoice
  147.          (prompt "How would you like an archive to be listed when it "
  148.                  "is double-clicked?"
  149.          )
  150.          (help @askchoice-help)
  151.          (choices
  152.             (cat #proprender "In a new lister (Browse).")
  153.             "In the same lister (GetDir)."
  154.          )
  155.       )
  156.       (* 2
  157.          (askchoice
  158.             (prompt "What do you want to happen when you drag and drop "
  159.                     "an archive in another lister?"
  160.             )
  161.             (help @askchoice-help)
  162.             (choices
  163.                (cat #proprender "Extract it (with LhA/LZX).")
  164.                "List it (with ArcDir). [needs Opus 5.5+]"
  165.             )
  166.          )
  167.       )
  168.    )     
  169. )
  170.  
  171. (set
  172.    #language
  173.    (if
  174.       (= (exists "ENV:Language") 1)
  175.       (getenv "Language")
  176.       ""
  177.    )
  178. )
  179. (set #catalogs
  180.    (askoptions
  181.       (prompt "Which language catalog(s) do you want to install?")
  182.       (help @askoptions-help)
  183.       (choices (cat #proprender "Nederlands") "Deutsch" "Français" "Norsk")
  184.       (default 
  185.          (+
  186.             (= #language "nederlands")
  187.             (* 2 (= #language "deutsch"))
  188.             (* 4 (= #language "français"))
  189.             (* 8 (= #language "norsk"))
  190.          )
  191.       )
  192.    )
  193. )
  194.  
  195.  
  196. ;=============================================================================
  197. ; copy the files
  198.  
  199. (set @default-dest "DOpus5:")
  200.  
  201. (copyfiles
  202.    (source "ARexx")
  203.    (dest "DOpus5:ARexx")
  204.    (pattern "#?")
  205.    (files)
  206. )
  207. (copyfiles
  208.    (source "C")
  209.    (dest "DOpus5:C")
  210.    (pattern "#?")
  211.    (files)
  212. )
  213.  
  214. (set #storedir
  215.    (if
  216.       (= (exists "DOpus5:Storage/Filetypes") 2)
  217.       "DOpus5:Storage/Filetypes"
  218.       "DOpus5:Storage"
  219.    )
  220. )
  221. (set #n 0)
  222. (while
  223.    (set #arctype (select #n "LHA" "LZX" ""))
  224.    (
  225.       (if
  226.          #storeold
  227.          (copyfiles
  228.             (source (cat "DOpus5:Filetypes/" #arctype " archive"))
  229.             (dest #storedir)
  230.          )
  231.       )
  232.       (copyfiles
  233.          (source
  234.             (select
  235.                #how
  236.                (cat "Filetypes/" #arctype " archive")
  237.                (cat "Storage/Filetypes/" #arctype " archive_GetDir")
  238.                (cat "Storage/Filetypes/" #arctype " archive_Browse&DnD")
  239.                (cat "Storage/Filetypes/" #arctype " archive_GetDir&DnD")
  240.             )
  241.          )
  242.          (dest "DOpus5:Filetypes")
  243.          (newname (cat #arctype " archive"))
  244.       )
  245.       (set #n (+ #n 1))
  246.    )
  247. )
  248.  
  249. (set #n 0)
  250. (while
  251.    (set #thiscat (select #n "nederlands" "deutsch" "français" "norsk" ""))
  252.    (
  253.       (if
  254.          (in #catalogs #n)
  255.          (copyfiles
  256.             (source (cat "Locale/Catalogs/" #thiscat "/ArcDir.catalog"))
  257.             (dest (cat "LOCALE:Catalogs/" #thiscat))
  258.          )
  259.       )
  260.       (set #n (+ #n 1))
  261.    )
  262. )
  263.  
  264.  
  265. ;=============================================================================
  266. ; exit message
  267.  
  268. (exit "To be able to use ArcDir.dopus5, ARexx needs to be activated "
  269.       "by running the RexxMast program from the System drawer.\n\n"
  270.       "You may uninstall ArcDir by running this installation script again."
  271. )
  272.